const mongoose = require('mongoose')

// 创建规则
const stuSchema = new mongoose.Schema( {
    name: {
        type: String,

    },
    age: {
        type: Number,

    },
    gender: {
        type: String,
    },
    email: {
        type: String,
    },
    hobbies: [ String ],
    school: {
        type: String,
    },
    enterDate: {
        type: Date,
        default: Date.now()
    }
} )

//数据构造函数
const Student = mongoose.model('Student', stuSchema)

// 导出构造函数
module.exports  = Student